package com.tikin.mqtt

//    <topic>subscribe.device._88EJdvCGkyhhJ9P5TvXpA==.BEIJING</topic>
//    <topic>subscribe.device.*.BEIJING</topic>
//    <topic>subscribe.#.device.BEIJING</topic>
//    <appKey>_88EJdvCGkyhhJ9P5TvXpA==</appKey>
//    <secret>52!}61(R^HIT2|X]</secret>


data class MqttManagerOption(
    val uri:String,
    val userName:String,
    val password:String,
    val topicLoc:String,
    val clientId:String,
    val topic:Array<String>,
    val qos:IntArray,
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as MqttManagerOption

        if (uri != other.uri) return false
        if (userName != other.userName) return false
        if (password != other.password) return false
        if (topicLoc != other.topicLoc) return false
        if (clientId != other.clientId) return false
        if (!topic.contentEquals(other.topic)) return false
        if (!qos.contentEquals(other.qos)) return false

        return true
    }

    override fun hashCode(): Int {
        var result = uri.hashCode()
        result = 31 * result + userName.hashCode()
        result = 31 * result + password.hashCode()
        result = 31 * result + topicLoc.hashCode()
        result = 31 * result + clientId.hashCode()
        result = 31 * result + topic.contentHashCode()
        result = 31 * result + qos.contentHashCode()
        return result
    }

}